3.2.79 \(\int \frac {\sec ^2(e+f x)}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))} \, dx\) [179]

Optimal. Leaf size=81 \[ -\frac {\text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {2} \sqrt {a} c f}+\frac {\cot (e+f x) \sqrt {a+a \sec (e+f x)}}{a c f} \]

[Out]

-1/2*arctan(1/2*a^(1/2)*tan(f*x+e)*2^(1/2)/(a+a*sec(f*x+e))^(1/2))/c/f*2^(1/2)/a^(1/2)+cot(f*x+e)*(a+a*sec(f*x
+e))^(1/2)/a/c/f

________________________________________________________________________________________

Rubi [A]
time = 0.15, antiderivative size = 116, normalized size of antiderivative = 1.43, number of steps used = 4, number of rules used = 4, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {4049, 79, 65, 214} \begin {gather*} -\frac {\tan (e+f x)}{f \sqrt {a \sec (e+f x)+a} (c-c \sec (e+f x))}-\frac {\tan (e+f x) \tanh ^{-1}\left (\frac {\sqrt {c-c \sec (e+f x)}}{\sqrt {2} \sqrt {c}}\right )}{\sqrt {2} \sqrt {c} f \sqrt {a \sec (e+f x)+a} \sqrt {c-c \sec (e+f x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]^2/(Sqrt[a + a*Sec[e + f*x]]*(c - c*Sec[e + f*x])),x]

[Out]

-(Tan[e + f*x]/(f*Sqrt[a + a*Sec[e + f*x]]*(c - c*Sec[e + f*x]))) - (ArcTanh[Sqrt[c - c*Sec[e + f*x]]/(Sqrt[2]
*Sqrt[c])]*Tan[e + f*x])/(Sqrt[2]*Sqrt[c]*f*Sqrt[a + a*Sec[e + f*x]]*Sqrt[c - c*Sec[e + f*x]])

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 79

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(-(b*e - a*f
))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p + 1)*(c*f - d*e))), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1
) + c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e,
f, n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || L
tQ[p, n]))))

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 4049

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]
*(d_.) + (c_))^(n_), x_Symbol] :> Dist[a*c*g*(Cot[e + f*x]/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[c + d*Csc[e + f*x]
])), Subst[Int[(g*x)^(p - 1)*(a + b*x)^(m - 1/2)*(c + d*x)^(n - 1/2), x], x, Csc[e + f*x]], x] /; FreeQ[{a, b,
 c, d, e, f, g, m, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {\sec ^2(e+f x)}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))} \, dx &=-\frac {(a c \tan (e+f x)) \text {Subst}\left (\int \frac {x}{(a+a x) (c-c x)^{3/2}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)}}\\ &=-\frac {\tan (e+f x)}{f \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))}+\frac {(a \tan (e+f x)) \text {Subst}\left (\int \frac {1}{(a+a x) \sqrt {c-c x}} \, dx,x,\sec (e+f x)\right )}{2 f \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)}}\\ &=-\frac {\tan (e+f x)}{f \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))}-\frac {(a \tan (e+f x)) \text {Subst}\left (\int \frac {1}{2 a-\frac {a x^2}{c}} \, dx,x,\sqrt {c-c \sec (e+f x)}\right )}{c f \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)}}\\ &=-\frac {\tan (e+f x)}{f \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))}-\frac {\tanh ^{-1}\left (\frac {\sqrt {c-c \sec (e+f x)}}{\sqrt {2} \sqrt {c}}\right ) \tan (e+f x)}{\sqrt {2} \sqrt {c} f \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.47, size = 73, normalized size = 0.90 \begin {gather*} -\frac {\cot \left (\frac {1}{2} (e+f x)\right ) \left (-2+\sqrt {2} \text {ArcTan}\left (\frac {\sqrt {-1+\sec (e+f x)}}{\sqrt {2}}\right ) \sqrt {-1+\sec (e+f x)}\right )}{2 c f \sqrt {a (1+\sec (e+f x))}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[e + f*x]^2/(Sqrt[a + a*Sec[e + f*x]]*(c - c*Sec[e + f*x])),x]

[Out]

-1/2*(Cot[(e + f*x)/2]*(-2 + Sqrt[2]*ArcTan[Sqrt[-1 + Sec[e + f*x]]/Sqrt[2]]*Sqrt[-1 + Sec[e + f*x]]))/(c*f*Sq
rt[a*(1 + Sec[e + f*x])])

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(203\) vs. \(2(70)=140\).
time = 3.11, size = 204, normalized size = 2.52

method result size
default \(-\frac {\sqrt {\frac {a \left (\cos \left (f x +e \right )+1\right )}{\cos \left (f x +e \right )}}\, \left (\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (\frac {\sin \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}-\cos \left (f x +e \right )+1}{\sin \left (f x +e \right )}\right )-\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \ln \left (\frac {\sin \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}-\cos \left (f x +e \right )+1}{\sin \left (f x +e \right )}\right )+2 \cos \left (f x +e \right ) \sin \left (f x +e \right )\right )}{2 c f \left (\cos ^{2}\left (f x +e \right )-1\right ) a}\) \(204\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)^2/(c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2/c/f*(a*(cos(f*x+e)+1)/cos(f*x+e))^(1/2)*((-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*cos(f*x+e)^2*ln((sin(f*x+e)
*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)-cos(f*x+e)+1)/sin(f*x+e))-(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*ln((sin(f
*x+e)*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)-cos(f*x+e)+1)/sin(f*x+e))+2*cos(f*x+e)*sin(f*x+e))/(cos(f*x+e)^2-1)
/a

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2/(c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

-integrate(sec(f*x + e)^2/(sqrt(a*sec(f*x + e) + a)*(c*sec(f*x + e) - c)), x)

________________________________________________________________________________________

Fricas [A]
time = 1.74, size = 282, normalized size = 3.48 \begin {gather*} \left [\frac {\sqrt {2} a \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sqrt {-\frac {1}{a}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, \cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1}\right ) \sin \left (f x + e\right ) + 4 \, \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{4 \, a c f \sin \left (f x + e\right )}, \frac {\sqrt {2} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) \sin \left (f x + e\right ) + 2 \, \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{2 \, a c f \sin \left (f x + e\right )}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2/(c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[1/4*(sqrt(2)*a*sqrt(-1/a)*log((2*sqrt(2)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sqrt(-1/a)*cos(f*x + e)*sin(
f*x + e) + 3*cos(f*x + e)^2 + 2*cos(f*x + e) - 1)/(cos(f*x + e)^2 + 2*cos(f*x + e) + 1))*sin(f*x + e) + 4*sqrt
((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e))/(a*c*f*sin(f*x + e)), 1/2*(sqrt(2)*sqrt(a)*arctan(sqrt(2)*sq
rt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)/(sqrt(a)*sin(f*x + e)))*sin(f*x + e) + 2*sqrt((a*cos(f*x +
e) + a)/cos(f*x + e))*cos(f*x + e))/(a*c*f*sin(f*x + e))]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {\int \frac {\sec ^{2}{\left (e + f x \right )}}{\sqrt {a \sec {\left (e + f x \right )} + a} \sec {\left (e + f x \right )} - \sqrt {a \sec {\left (e + f x \right )} + a}}\, dx}{c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)**2/(c-c*sec(f*x+e))/(a+a*sec(f*x+e))**(1/2),x)

[Out]

-Integral(sec(e + f*x)**2/(sqrt(a*sec(e + f*x) + a)*sec(e + f*x) - sqrt(a*sec(e + f*x) + a)), x)/c

________________________________________________________________________________________

Giac [A]
time = 0.99, size = 132, normalized size = 1.63 \begin {gather*} \frac {\frac {\sqrt {2} \log \left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2}\right )}{\sqrt {-a} c \mathrm {sgn}\left (\cos \left (f x + e\right )\right )} - \frac {4 \, \sqrt {2} \sqrt {-a}}{{\left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2} - a\right )} c \mathrm {sgn}\left (\cos \left (f x + e\right )\right )}}{4 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^2/(c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(1/2),x, algorithm="giac")

[Out]

1/4*(sqrt(2)*log((sqrt(-a)*tan(1/2*f*x + 1/2*e) - sqrt(-a*tan(1/2*f*x + 1/2*e)^2 + a))^2)/(sqrt(-a)*c*sgn(cos(
f*x + e))) - 4*sqrt(2)*sqrt(-a)/(((sqrt(-a)*tan(1/2*f*x + 1/2*e) - sqrt(-a*tan(1/2*f*x + 1/2*e)^2 + a))^2 - a)
*c*sgn(cos(f*x + e))))/f

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} -\int \frac {1}{\sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}\,\left (c\,\cos \left (e+f\,x\right )-c\,\left (\frac {\cos \left (2\,e+2\,f\,x\right )}{2}+\frac {1}{2}\right )\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(e + f*x)^2*(a + a/cos(e + f*x))^(1/2)*(c - c/cos(e + f*x))),x)

[Out]

-int(1/((a + a/cos(e + f*x))^(1/2)*(c*cos(e + f*x) - c*(cos(2*e + 2*f*x)/2 + 1/2))), x)

________________________________________________________________________________________